/*
    RExLib project, file dbconnectorprivate.cpp
    Copyright (C) 2012  Sarvaritdinov Ravil ra9oaj@gmail.com

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
*/


#ifndef DBCONNECOPRIVATE_H
#define DBCONNECOPRIVATE_H

#include <stdlib.h>

namespace rex {

class DBconnectorPrivate
{

public:

  enum _STATE_
  {
    DB_UNCONNECTED,
    DB_CONNECTED,
    DB_ERROR
  };

  enum _ERROR_
  {
    DBE_NOERROR,
    DBE_DRIVER,
    DBE_CONNECT,
    DBE_AUTH,
    DBE_QUERY
  };

  virtual void setDBName ( const char *name ) =0;
  virtual void setDBUser ( const char *username, const char *passw = 0 ) =0;
  virtual void setSSLConnection ( bool sslf = true ) =0;
  virtual void setUnixConnection ( bool unixf = true ) =0;
  virtual bool openDB ( const char *host, uint port = 0 ) =0;
  virtual bool closeDB() =0;
  virtual int dbState() const =0;
  virtual char* value ( int val ) =0;
  virtual unsigned long long rowCount() const =0;
  virtual unsigned long long affectedRows() const =0;
  virtual unsigned fieldCount() const =0;
  virtual int query ( const char* qry ) =0;
  virtual bool next() =0;
  virtual bool first() =0;
  virtual bool seek ( unsigned long long pos ) =0;
  virtual int nativeErrorNo() const =0;
  virtual const char* nativeErrorString() const =0;
  virtual int errorCode() const =0;
  virtual const char* errorString() const =0;
};

}
#endif // DBCONNECOPRIVATE_H
